-- GENERATED SPELL FOR [Onslaught Darkweaver] --


function spell0_29614(pUnit, Event) --@Demon Armor,Self--
pUnit:FullCastSpellOnTarget(13787,pUnit)
pUnit:RegisterEvent('Sorts_29614', 0, 1)
end

function spell1_29614(pUnit, Event) --@Metamorphosis,Self--
pUnit:FullCastSpellOnTarget(54840,pUnit)
pUnit:RegisterEvent('Sorts_29614', 45326, 1)
end

function spell2_29614(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(12739,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_29614', 3000, 1)
end

function spell3_29614(pUnit, Event) --@Summon Imp,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(11939,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_29614', 1, 1)
end

function spell4_29614(pUnit, Event) --@Summon Succubus,Self--
pUnit:FullCastSpellOnTarget(8722,pUnit)
pUnit:RegisterEvent('Sorts_29614', 667, 1)
end

function Sorts_29614(pUnit, Event)
local choix_sorts_29614 = math.random(0, 4)
if choix_sorts_29614 == 0 then
pUnit:RegisterEvent('spell0_29614', 1, 1)
end
if choix_sorts_29614 == 1 then
pUnit:RegisterEvent('spell1_29614', 1, 1)
end
if choix_sorts_29614 == 2 then
pUnit:RegisterEvent('spell2_29614', 1, 1)
end
if choix_sorts_29614 == 3 then
pUnit:RegisterEvent('spell3_29614', 1, 1)
end
if choix_sorts_29614 == 4 then
pUnit:RegisterEvent('spell4_29614', 1, 1)
end
end

function mob29614_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_29614', math.random(1500, 3000), 1)
end

function mob29614_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob29614_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob29614_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(29614, 1, 'mob29614_Action')
RegisterUnitEvent(29614, 2, 'mob29614_Leave')
RegisterUnitEvent(29614, 3, 'mob29614_Kill')
RegisterUnitEvent(29614, 4, 'mob29614_Die')
